<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Utilisateur {
    
    private $idUser;
    private $idFace;
    private $idGoogle;
    private $Nom;
    private $Prenom;
    private $cheminPhoto;
    
    public function hydrate(array $donnees){
        foreach ($donnees as $key => $value)
        {
            $method = 'set'.ucfirst($key);
            if (method_exists($this, $method))
            {
                $this->$method($value);
            }
        }
    }
    
    public function getIdUser() {
        return $this->idUser;
    }

    public function getIdFace() {
        return $this->idFace;
    }

    public function getIdGoogle() {
        return $this->idGoogle;
    }

    public function getNom() {
        return $this->Nom;
    }

    public function getPrenom() {
        return $this->Prenom;
    }

    public function getCheminPhoto() {
        return $this->cheminPhoto;
    }

    public function setIdUser($idUser) {
        $this->idUser = (int)$idUser;
    }

    public function setIdFace($idFace) {
        $this->idFace = (int)$idFace;
    }

    public function setIdGoogle($idGoogle) {
        if (is_string($idGoogle) && strlen($idGoogle) <= 50) {
            $this->idGoogle = $idGoogle;
         }
    }

    public function setNom($Nom) {
         if (is_string($Nom) && strlen($Nom) <= 100) {
            $this->Nom = $Nom;
         }
        
    }

    public function setPrenom($Prenom) {
        if (is_string($Prenom) && strlen($Prenom) <= 100) {
            $this->Prenom = $Prenom;
         }
    }

    public function setCheminPhoto($cheminPhoto) {
        if (is_string($cheminPhoto) && strlen($cheminPhoto) <= 100) {
            $this->cheminPhoto = $cheminPhoto;
         }
    }


}

